using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CMS.Domain.Entity;
using CMS.Infrastructrue.Persistence.Configuration.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace CMS.Infrastructrue.Persistence.Configuration
{
    public class UsersConfiguration:BaseEntityConfiguration<Users>
    {
        /// <summary>
        /// 用户表
        /// </summary>
        /// <param name="builder"></param>

        public override void Configure(EntityTypeBuilder<Users> builder)
        {
            base.Configure(builder);
             builder.ToTable("users");
            
            
            builder.Property(x => x.UserName).HasColumnName("username").HasMaxLength(2000).HasColumnOrder(1);
            builder.Property(x => x.PassWord).HasColumnName("password").HasMaxLength(2000).HasColumnOrder(2);
            builder.Property(x => x.Email).HasColumnName("email").HasMaxLength(2000).HasColumnOrder(3);
            builder.Property(x => x.IsAdministor).HasColumnName("is_administor").HasMaxLength(2000).HasColumnOrder(4);
            builder.Property(x => x.AvatarId).HasColumnName("avatar_id").HasMaxLength(2000).HasColumnOrder(5);
        }
        
    }
}